import React from "react";
import { ListType } from "../../views/home";
import { GoodInfo } from "../goodInfo";

interface PorpsType extends ListType {
  onClick?: () => void;
}

export const ListItem: React.FC<PorpsType> = ({
  id,
  images,
  title,
  word,
  price,
  onClick,
}) => {
  return (
    <div onClick={onClick}>
      <dl key={id} className="list-item">
        <dt>
          <img src={images[0]} alt="" />
        </dt>
        <dd>
          <GoodInfo title={title} price={price} word={word}></GoodInfo>
        </dd>
      </dl>
    </div>
  );
};
